import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooAdminAppletController } from '../../../controllers';
const uctooadminAppletRouter = new Router();
const adminAppletController = new uctooAdminAppletController();

uctooadminAppletRouter.post('/add', requireUser, adminAppletController.add);
uctooadminAppletRouter.post('/edit', requireUser, rowLevelPermission('uctoo/admin_applet'), adminAppletController.edit);
uctooadminAppletRouter.post('/del', requireUser, rowLevelPermission('uctoo/admin_applet'), adminAppletController.delete);

//For getting adminApplet with permission control
uctooadminAppletRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/admin_applet'), adminAppletController.getSingle);
uctooadminAppletRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/admin_applet'), adminAppletController.getMany);
uctooadminAppletRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/admin_applet'), adminAppletController.getMany);

//#endregion AutoCreateCode
export default uctooadminAppletRouter;
